<%--
  Created by IntelliJ IDEA.
  User: chentao
  Date: 2015/8/20
  Time: 11:15
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" pageEncoding="utf-8" %>
<%@ include file="/include/taglibs.jsp" %>
<style>
    .fixed-table-container {
        height: auto !important;
        padding-bottom: 0 !important;
    }

    .fixed-table-pagination .pagination-detail, .fixed-table-pagination div.pagination {
        margin-top: 15px !important;
    }
    .content-title {
        height: 94px!important;
        background: #fff!important;
        font-size: 26px!important;
        padding-left: 15px!important;
        line-height: 54px!important;
        margin: -15px -15px 0!important;
    }
    .btn-default-button {
        background: #3c8dbc!important;
        border-radius: 3px!important;
    }

</style>
<script src="${path}/static/static/security/admin/index.js"></script>
<link rel="stylesheet" href="${path}/static/css/public/order.css">
<div class="form-inline" role="form" id="admintoolbar">
    <input id="admin" type="hidden" value="<%=request.getSession().getAttribute("super") %>"/>
    <button type="button" class="btn btn-default btn-default-button" id="addAdmin">
        <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>
        创建账号
    </button>
</div>

<table id="table"
       data-toggle="table"
       data-toolbar="#admintoolbar"
       data-url="${path}/web/admin/adminQuery"
       data-height="540"
       data-side-pagination="server"
       data-pagination="true"
       data-page-list="[5, 10, 20, 50, 100, 200]"
       data-search="true" data-show-refresh="true"
       data-search-tip="搜索用户账号"
       data-show-columns="true">
    <thead>
    <tr>
        <th data-field="id">编号</th>
        <th data-field="userName">用户账号</th>
        <th data-field="enable" data-formatter="Admin.showEnable">状态</th>
    </tr>
    </thead>
</table>


<div id="addAdmin-div" class="slidingmenu box-model box box-info">
    <div class="box box-info">

        <div class="box-header">
            <h3 class="box-title">创建帐号</h3>
        </div>

        <div class="box-body">
            <form role="form" action="/web/admin/saveOrUpdateAdmin" method="post" id="adminForm"
                  data-callback="saveAdmin">
                <input type="hidden" name="id"/>
                <div class="form-group">
                    <label>用户账号:<a href="#" data-toggle="tooltip" data-placement="right"
                                   title="请认真填写账号">?</a></label>
                    <input type="text" id="admin_name" class="form-control" name="userName" data-msg="请输入账号"
                           placeholder="请输入账号" required="true" maxlength="16"/>
                </div>
                <div class="form-group">
                    <label>用户密码:<a href="#" data-toggle="tooltip" data-placement="right"
                                   title="请认真填写密码">?</a></label>
                    <input type="text" id="admin_pwd" class="form-control" name="pwd" placeholder="请输入密码"
                           required="true" rangelength="[6,16]"/>
                </div>
            </form>
        </div>
    </div>
    <div class="box-footer">
        <button class="btn btn-info form-submit" form-id="adminForm">确定</button>&nbsp;&nbsp;
        <button class="btn btn-error close-model">关闭</button>
    </div>
</div>

<div id="editAdmin-div" class="slidingmenu box-model box box-info slidingmenu-show" callback="Admin.editAdminShow">
    <div class="box box-info">

        <div class="box-body">
            <form role="form" id="mergeAdmin" action="/web/admin/saveOrUpdateAdmin" method="post">
                <input type="hidden" id="id" name="id"/>
                <div class="form-group">
                    <label>用户账号:</label>
                    <input type="text" id="modify_admin" class="form-control" name="userName" data-msg="请输入账号"
                           placeholder="请输入账号" required="true" maxlength="16"/>
                </div><!-- /.form group -->
                <div class="form-group">
                    <label>用户密码:</label>
                    <input type="text" id="modify_admin_pwd" class="form-control" name="pwd" placeholder="请输入密码"
                           required="true" rangelength="[6,16]"/>
                </div><!-- /.form group -->
            </form>
        </div>
    </div>
    <div class="box-footer">
        <button class="btn btn-info form-submit" form-id="mergeAdmin">修改</button>
        <button class="btn btn-danger" id="deleteAdmin">删除</button>
    </div>
</div>

